
//
//  LDY_PlayTableViewCell.m
//  ProjectB
//
//  Created by dlios on 15/11/23.
//  Copyright © 2015年 lulu. All rights reserved.
//

#import "LDY_PlayTableViewCell.h"

#define KWIDTH ([UIScreen mainScreen].bounds.size.width/375)
#define KHEIGHT ([UIScreen mainScreen].bounds.size.height/667)

@implementation LDY_PlayTableViewCell

- (void)dealloc
{
    [_visualEffectView release];
    [_picImageView release];
    [_nameLabel release];
    [_musicNameLabel release];
    [_enterImageView release];
    [super dealloc];
}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier

{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        self.contentView.backgroundColor = [UIColor clearColor];
        
        self.visualEffectView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle: UIBlurEffectStyleDark]];
        [self.contentView addSubview:self.visualEffectView];
        [_visualEffectView release];
        
        self.picImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.picImageView];
        [_picImageView release];
        
        self.nameLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.nameLabel];
        [_nameLabel release];
        
        self.musicNameLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.musicNameLabel];
        [_musicNameLabel release];
        
        self.enterImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"sanjiaoXin32"]];
        [self.contentView addSubview:self.enterImageView];
        [_enterImageView release];
    }
    
    return self;
    
}


- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.visualEffectView.frame = CGRectMake(KWIDTH * 4, 0, KWIDTH * 375 - KWIDTH * 8, self.contentView.frame.size.height - KHEIGHT * 2);
    self.visualEffectView.alpha = 1.0;
    
    self.picImageView.frame = CGRectMake(KWIDTH * 20, KHEIGHT * 10, KWIDTH * 27, KWIDTH * 27);
//    self.picImageView.backgroundColor = [UIColor cyanColor];
    
    self.nameLabel.frame = CGRectMake(KWIDTH * 30 + self.picImageView.frame.size.width, 0, KWIDTH * 100, self.contentView.frame.size.height - KHEIGHT * 2);
    self.nameLabel.textColor = [UIColor whiteColor];
    self.nameLabel.font = [UIFont systemFontOfSize:15 * KHEIGHT];
//    self.nameLabel.backgroundColor = [UIColor blackColor];
    
    self.musicNameLabel.frame = CGRectMake(KWIDTH * 30 + self.picImageView.frame.size.width + self.nameLabel.frame.size.width, 0, KWIDTH * 200, self.contentView.frame.size.height - KHEIGHT * 2);
    self.musicNameLabel.font = [UIFont systemFontOfSize:14];
    self.musicNameLabel.textColor = [UIColor lightGrayColor];
    
    self.enterImageView.frame = CGRectMake(KWIDTH * 375 - KWIDTH * 45, KHEIGHT * 10, KWIDTH * 25, KWIDTH * 25);
    self.enterImageView.alpha = 0.8;
//    self.enterImageView.backgroundColor = [UIColor orangeColor];
    
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
